package com.ace.lab.pays.service;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.5.0)",
    comments = "Source: account_service.proto")
public final class AccountServiceGrpc {

  private AccountServiceGrpc() {}

  public static final String SERVICE_NAME = "AccountService";

  // Static method descriptors that strictly reflect the proto.
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor<com.ace.lab.pays.dto.BalanceQueryRequestProto.BalanceQueryRequest,
      com.ace.lab.pays.dto.BalanceQueryResponseProto.BalanceQueryResponse> METHOD_QUERY_ACCOUNT_BALANCE =
      io.grpc.MethodDescriptor.<com.ace.lab.pays.dto.BalanceQueryRequestProto.BalanceQueryRequest, com.ace.lab.pays.dto.BalanceQueryResponseProto.BalanceQueryResponse>newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
          .setFullMethodName(generateFullMethodName(
              "AccountService", "queryAccountBalance"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              com.ace.lab.pays.dto.BalanceQueryRequestProto.BalanceQueryRequest.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              com.ace.lab.pays.dto.BalanceQueryResponseProto.BalanceQueryResponse.getDefaultInstance()))
          .build();
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor<com.ace.lab.pays.dto.AccountProto.Account,
      com.google.protobuf.Empty> METHOD_CREATE_ACCOUNT =
      io.grpc.MethodDescriptor.<com.ace.lab.pays.dto.AccountProto.Account, com.google.protobuf.Empty>newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
          .setFullMethodName(generateFullMethodName(
              "AccountService", "createAccount"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              com.ace.lab.pays.dto.AccountProto.Account.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              com.google.protobuf.Empty.getDefaultInstance()))
          .build();

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static AccountServiceStub newStub(io.grpc.Channel channel) {
    return new AccountServiceStub(channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static AccountServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    return new AccountServiceBlockingStub(channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static AccountServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    return new AccountServiceFutureStub(channel);
  }

  /**
   */
  public static abstract class AccountServiceImplBase implements io.grpc.BindableService {

    /**
     */
    public void queryAccountBalance(com.ace.lab.pays.dto.BalanceQueryRequestProto.BalanceQueryRequest request,
        io.grpc.stub.StreamObserver<com.ace.lab.pays.dto.BalanceQueryResponseProto.BalanceQueryResponse> responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_QUERY_ACCOUNT_BALANCE, responseObserver);
    }

    /**
     */
    public void createAccount(com.ace.lab.pays.dto.AccountProto.Account request,
        io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_CREATE_ACCOUNT, responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            METHOD_QUERY_ACCOUNT_BALANCE,
            asyncUnaryCall(
              new MethodHandlers<
                com.ace.lab.pays.dto.BalanceQueryRequestProto.BalanceQueryRequest,
                com.ace.lab.pays.dto.BalanceQueryResponseProto.BalanceQueryResponse>(
                  this, METHODID_QUERY_ACCOUNT_BALANCE)))
          .addMethod(
            METHOD_CREATE_ACCOUNT,
            asyncUnaryCall(
              new MethodHandlers<
                com.ace.lab.pays.dto.AccountProto.Account,
                com.google.protobuf.Empty>(
                  this, METHODID_CREATE_ACCOUNT)))
          .build();
    }
  }

  /**
   */
  public static final class AccountServiceStub extends io.grpc.stub.AbstractStub<AccountServiceStub> {
    private AccountServiceStub(io.grpc.Channel channel) {
      super(channel);
    }

    private AccountServiceStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected AccountServiceStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new AccountServiceStub(channel, callOptions);
    }

    /**
     */
    public void queryAccountBalance(com.ace.lab.pays.dto.BalanceQueryRequestProto.BalanceQueryRequest request,
        io.grpc.stub.StreamObserver<com.ace.lab.pays.dto.BalanceQueryResponseProto.BalanceQueryResponse> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_QUERY_ACCOUNT_BALANCE, getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void createAccount(com.ace.lab.pays.dto.AccountProto.Account request,
        io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_CREATE_ACCOUNT, getCallOptions()), request, responseObserver);
    }
  }

  /**
   */
  public static final class AccountServiceBlockingStub extends io.grpc.stub.AbstractStub<AccountServiceBlockingStub> {
    private AccountServiceBlockingStub(io.grpc.Channel channel) {
      super(channel);
    }

    private AccountServiceBlockingStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected AccountServiceBlockingStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new AccountServiceBlockingStub(channel, callOptions);
    }

    /**
     */
    public com.ace.lab.pays.dto.BalanceQueryResponseProto.BalanceQueryResponse queryAccountBalance(com.ace.lab.pays.dto.BalanceQueryRequestProto.BalanceQueryRequest request) {
      return blockingUnaryCall(
          getChannel(), METHOD_QUERY_ACCOUNT_BALANCE, getCallOptions(), request);
    }

    /**
     */
    public com.google.protobuf.Empty createAccount(com.ace.lab.pays.dto.AccountProto.Account request) {
      return blockingUnaryCall(
          getChannel(), METHOD_CREATE_ACCOUNT, getCallOptions(), request);
    }
  }

  /**
   */
  public static final class AccountServiceFutureStub extends io.grpc.stub.AbstractStub<AccountServiceFutureStub> {
    private AccountServiceFutureStub(io.grpc.Channel channel) {
      super(channel);
    }

    private AccountServiceFutureStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected AccountServiceFutureStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new AccountServiceFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<com.ace.lab.pays.dto.BalanceQueryResponseProto.BalanceQueryResponse> queryAccountBalance(
        com.ace.lab.pays.dto.BalanceQueryRequestProto.BalanceQueryRequest request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_QUERY_ACCOUNT_BALANCE, getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> createAccount(
        com.ace.lab.pays.dto.AccountProto.Account request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_CREATE_ACCOUNT, getCallOptions()), request);
    }
  }

  private static final int METHODID_QUERY_ACCOUNT_BALANCE = 0;
  private static final int METHODID_CREATE_ACCOUNT = 1;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final AccountServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(AccountServiceImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_QUERY_ACCOUNT_BALANCE:
          serviceImpl.queryAccountBalance((com.ace.lab.pays.dto.BalanceQueryRequestProto.BalanceQueryRequest) request,
              (io.grpc.stub.StreamObserver<com.ace.lab.pays.dto.BalanceQueryResponseProto.BalanceQueryResponse>) responseObserver);
          break;
        case METHODID_CREATE_ACCOUNT:
          serviceImpl.createAccount((com.ace.lab.pays.dto.AccountProto.Account) request,
              (io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  private static final class AccountServiceDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier {
    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.ace.lab.pays.service.AccountServiceProto.getDescriptor();
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (AccountServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new AccountServiceDescriptorSupplier())
              .addMethod(METHOD_QUERY_ACCOUNT_BALANCE)
              .addMethod(METHOD_CREATE_ACCOUNT)
              .build();
        }
      }
    }
    return result;
  }
}
